package com.briup.ch10;

/**
 * @Author briup-adam
 * @Date 2023/10/26 下午4:49
 * @Description
 **/

public class MyRunnable implements Runnable {
    @Override
    public void run() {
        for (int i = 0; i < 50; i++) {
            System.out.println(i);
        }
    }
}

class RunnableTest {
    public static void main(String[] args) {
        Runnable r = new MyRunnable();
        Thread t = new Thread(r);
        t.start();
        for (int i = 100; i < 150; i++) {
            System.out.println(i);
        }
        r=new Runnable() {
            @Override
            public void run() {
                for (int i = 250; i <300 ; i++) {
                    System.out.println(i);
                }
            }
        };
        Thread t1 = new Thread(r);
        t1.start();
        r=()->{
            for (int i = 250; i <300 ; i++) {
            System.out.println(i);
        }
        };
        t1=new Thread(r);
        t1.start();

    }
}